package com.hyt.it.ogt.kq.service.bm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.kq.service.bm.model.entity.ProjectStatistic;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author liuq
 * @since 2021-08-02
 */
public interface ProjectStatisticMapper extends BaseMapper<ProjectStatistic> {

    /**
     * 获取报名统计数据
     *
     * @param projectId 报名ID
     * @param areaCodes 区域code
     * @param deptIds   部门ID集合
     * @return
     */
    Optional<ProjectStatistic> getProjectStatistic(@Param("projectId") String projectId,
                                                   @Param("deptIds") Set<String> deptIds,
                                                   @Param("createDate") LocalDateTime createDate);

    /**
     * 获取累计统计数据大于3次的报名
     *
     * @return
     */
    List<ProjectStatistic> listAllProjectStatisticGtThree();
}
